import { PASS_ORDER_LIST} from "./actionsTypes";
export const paaOrderList = data => ({type: PASS_ORDER_LIST, data: data});
import paySuccessService from  '../services/paySuccessService';
import { Toast } from 'antd-mobile'


export const getOrderList =(data,callBack)=>{
	return (dispatch, getState)=> {
		Toast.hide();
		Toast.loading("", 30, () => Toast.info("网络错误", 2));
		//2 支付宝  3微信
		paySuccessService.getOrderList(data).then(resultData => {
			Toast.hide();
			if (resultData.code == 1000) {
				dispatch(paaOrderList(resultData.body))
			} else {
				Toast.info(resultData.msg);
			}
		},()=>{
			Toast.hide(); 
            Toast.info("系统繁忙，请稍后再试");
		});
	}
}